import { objectOmit } from '@vueuse/core'
import { type IData, defaultWithIData } from './database'
import type { IDict } from './dict'

export const defaultWithIDatabase: IDatabase = {
  id: -1,
  domain: '',
  port: -1,
  databaseName: '',
  databaseType: '',
  driver: '',
  description: '',
  userName: '',
  password: '',
  gmtCreate: '',
  gmtModified: '',
}

export interface IDatabase {
    id: number
    domain: string
    port: number
    databaseName: string
    databaseType: string
    driver: string
    description: string
    userName: string
    password: string
    gmtCreate: string
    gmtModified: string
  }
  
  export type DatabaseTableNeeds = Omit<
  IDatabase,
  'gmtCreate' | 'gmtModified'
  >


  export const defaultWithIDatabaseStepAssertion: IDatabaseStepAssertion = {
    mode: 'single_count_field_value',
    action: 'equal',
    express: '',
    value: '',
  }
  
  export interface IDatabaseStepAssertion {
    mode: 'single_count_field_value' | 'data_count'
    action:
      | 'contain'
      | 'not_contain'
      | 'equal'
      | 'not_equal'
      | 'great_then'
      | 'less_then'
    express: string
    value: string
  }
  

  export const defaultWithIDatabaseConstantSelectOptions: IDatabaseConstantSelectOptions = {
    db_assert_action: [],
    db_assert_mode: []
  }
  
  export interface IDatabaseConstantSelectOptions {
    db_assert_action: IDict[]
    db_assert_mode: IDict[]
  }